package com.xyw.his00.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xyw.his00.mapper.EmployeeMapper;
import com.xyw.his00.pojo.dbpojo.Employee;
import com.xyw.his00.service.Impl.dbImpl.EmployeeServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//@Lazy//懒加载，延迟到第一次使用进行bean对象的初始化

@RestController
@RequestMapping("/employee/")
public   class EmployeeController {
    @Resource
    private  EmployeeServiceImpl employeeService;
    @Resource
    private EmployeeMapper employeeMapper;

  //  @OptionLog
    //1.获取医生部门id和部门名
    @RequestMapping("getEmployeesDeptIdAndName")
    public List getEmployeesDeptIdAndName(){
      return employeeService.getDeptIdAndNames();
    }

    
    @GetMapping("selectDoctorsById")
    @ResponseBody
    public List<Employee> selectDoctorsById(@RequestParam("deptId") int id){
        QueryWrapper<Employee >queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("deptment_id",id);
        return  employeeMapper.selectList(queryWrapper);
    }
}
